var genres = Array();
var consoles = Array();

$(document).bind("mobileinit", function() { 
    $.mobile.defaultPageTransition = "slide";
    $(document).on('pagebeforeshow', '#cart', function(event, ui) {
    	$('#cart ul li.cartTotal').remove();
    	var count = $('#cart ul li.cartItem').length;
    	var total = 0;
    	$('#cart ul li.cartItem').each(function(i, item){
    		total += parseInt($(item).find('.priceTag').html().split('$')[1]);
    	});
    	$('#cart ul').append('<li class="cartTotal"><span class="cartTotalText">Total: '+count+' Games, $'+total+'</span><span class="saveCart"></span><div class="clearfix"></div></li>');
    	$('#cart ul').listview('refresh');
      });
});